package com.car.account.mapper;

import com.car.account.entity.PlatformPermission;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 董旭
 * @since 2024-08-28
 */
@Mapper
public interface PlatformPermissionMapper extends BaseMapper<PlatformPermission> {

    @Delete("delete from platform_permission where role = #{roleId}")
    int deleteByRoleId(@Param("roleId") Integer roleId);

    @Select("select resource_id from platform_permission where role = #{roleId}")
    List<Integer> selectByRoleId(@Param("roleId")Integer roleId);
}
